package com.hbx.controller;

import com.hbx.service.StatisticsService;
import com.hbx.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/*
 * @Author:hbx
 *
 * */
@RestController
@RequestMapping("/echarts")
@Api(tags = "统计处理器")
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;

    /**
     * 统计今日发布和总数
     * @return
     */
    @RequestMapping(value = "/getPushCount",method = RequestMethod.GET)
    @ApiOperation("统计今日发布和总数")
    public Result getPushCount(){
        Result r = new Result();
        statisticsService.getPushCount(r);
        return r;
    }

    /**
     * 统计7日注册数量
     * @return
     */
    @RequestMapping(value = "/getWeeksRegisterCount",method = RequestMethod.GET)
    @ApiOperation("统计7日注册数量")
    public Result getWeeksRegisterCount(){
        Result r = new Result();
        statisticsService.getWeeksRegisterCount(r);
        return r;
    }

    /**
     * 统计今日操作数量
     * @return
     */
    @RequestMapping(value = "/getOperaLogsCount",method = RequestMethod.GET)
    @ApiOperation("统计今日操作数量")
    public Result getOperaLogsCount(){
        Result r = new Result();
        statisticsService.getOperaLogsCount(r);
        return r;
    }
}
